`onAfterEnvironmentCompile` is a callback function that is triggered after the compilation of a single environment. You can access the build result information via the [stats](https://rspack.dev/api/javascript-api/stats) parameter.

Moreover, you can use `isWatch` to determine whether it is dev or build watch mode, and use `isFirstCompile` to determine whether it is the first build.

- **Type:**

```ts
function OnAfterEnvironmentCompile(
  callback: (params: {
    isFirstCompile: boolean;
    isWatch: boolean;
    stats?: Stats;
    environment: EnvironmentContext;
  }) => Promise<void> | void,
): void;
```
